package com.share.two.bio2;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;


public class Server {
	
	@SuppressWarnings("resource")
	public static void main(String[] args) throws IOException {
		ServerSocket server = new ServerSocket(12345);
		System.out.println("server启动。。。");
		
		ThreadPool threadPool = new ThreadPool(50, 100);
		System.out.println("threadPool启动。。。");
		
		while (true) {
			Socket accept = server.accept();
			
			ServerHandler serverHandler = new ServerHandler(accept);
			
			threadPool.execute(serverHandler);
			
			System.out.println("主线程");
		}
		
		
	}

}
